Skip to content

Add custom fields for events #1815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Add custom fields for events #1815

wants to merge 3 commits into from

Conversation

ejsmith
Copy link
Member

@ejsmith ejsmith commented Feb 2, 2025

No description provided.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds custom field support for events by updating the event model and repository logic, removing legacy query visitor code, and updating test infrastructure to support the new behavior.

  • Removed obsolete EventFieldsQueryVisitor usage and file.
  • Introduced automatic custom field creation in the event repository.
  • Updated the PersistentEvent model to implement virtual custom fields and modified test configurations accordingly.

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Exceptionless.Tests/Search/PersistentEventQueryValidatorTests.cs Removed legacy query visitor call in tests.
tests/Exceptionless.Tests/Search/EventIndexTests.cs Updated repository query to include organization filtering.
tests/Exceptionless.Tests/Migrations/FixDuplicateStacksMigrationTests.cs Set log level to Trace for migration tests.
tests/Exceptionless.Tests/AppWebHostFactory.cs Added Kibana container configuration.
src/Exceptionless.Core/Repositories/Queries/Visitors/EventFieldsQueryVisitor.cs Removed unused visitor implementation.
src/Exceptionless.Core/Repositories/EventRepository.cs Added auto-creation of custom fields and related tenant logic.
src/Exceptionless.Core/Repositories/Configuration/Indexes/EventIndex.cs Removed legacy dynamic mapping for event index custom fields.
src/Exceptionless.Core/Repositories/Configuration/ExceptionlessElasticConfiguration.cs Added index creation for custom fields.
src/Exceptionless.Core/Models/PersistentEvent.cs Updated Idx property type and implemented IHaveVirtualCustomFields.
Files not reviewed (1)
  • src/Exceptionless.Core/Exceptionless.Core.csproj: Language not supported

public IDictionary<string, object?> Idx { get; set; } = new DataDictionary();

object? IHaveVirtualCustomFields.GetCustomField(string name) => Data?[name];
IDictionary<string, object?> IHaveVirtualCustomFields.GetCustomFields() => Data ?? [];
Copy link
Preview

Copilot AI Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using an empty array literal '[]' as a fallback for an IDictionary<string, object?> is invalid. Replace '[]' with an appropriate empty dictionary initializer (e.g. 'new DataDictionary()').

Suggested change
IDictionary<string, object?> IHaveVirtualCustomFields.GetCustomFields() => Data ?? [];
IDictionary<string, object?> IHaveVirtualCustomFields.GetCustomFields() => Data ?? new DataDictionary();

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants